function run ( data ) {
	data = data.trim();
	if ( data ) {
		// Inspired by code by Andrea Giammarchi
		// http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
		var head = document.getElementsByTagName("head")[0] || document.documentElement,
			script = document.createElement("script");

		script.type = "text/javascript";
		if ( $.isIE )
			script.text = data;
		else
			script.appendChild( document.createTextNode( data ) );
		head.appendChild( script );
		head.removeChild( script );
	}
}

function info (s, color) {
	if (s === undefined)
		return $('#output ol').empty();
	$('#output ol').append('<li><span style="color:{1}">{0}</span></li>'.format(s, color || '#000'));	
}

function assert(expression, expected) {
	var new_expression = '__assert_start=new Date;__assert_value=' + expression + ';__assert_time = new Date - __assert_start;';
	run(new_expression);
	if (window.__assert_value == expected) {
		info ('Pass : [<b>' + expression + '</b>] {0} ms'.format(__assert_time), 'green');
	} else {
		info ('Fail : [<b>' + expression + '</b>] {expected: {0}, real : {1}}'.format(expected, __assert_value), 'red');	
	}
}

